package cn.weekdragon.gscore.adapter.filter.impl;

import cn.weekdragon.gscore.adapter.filter.BotFilter;
import cn.weekdragon.gscore.adapter.model.EventExt;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class KeywordBlockFilter implements BotFilter {

    private final Set<String> keywordSet = new HashSet<>();

    public KeywordBlockFilter(String keywords) {
        keywordSet.addAll(Arrays.asList(keywords.split(",")));
    }

    @Override
    public boolean doFilter(EventExt eventExt) {
        return keywordSet.contains(eventExt.argsText());
    }
}
